package com.hejia.alauda.entity;

import javax.persistence.Column;

/**
 * 兑吧的订单
 * @author paul
 *
 */
public class DuibaOrder extends BaseEntity {

	/**
	 * 
	 */
	private static final long serialVersionUID = -2660489490682123936L;
	
	public static int STATUS_WITHHOLD = 2; //预扣
	public static int STATUS_SUCCESS = 1; //成功
	public static int STATUS_FAILURE = 0; //失败
	
	@Column
	private String qq; //用户qq号
	
	@Column
	private String alipay;//用户支付宝账号

	@Column
	private String actualPrice; //此次兑换实际扣除开发者账户费用，单位为分，请自行转换单位
	
	@Column
	private String ip;
	
	@Column
	private String orderNum; //兑吧订单号(请记录到数据库中)
	
	@Column
	private String description; //本次积分消耗的描述(带中文，请用utf-8进行url解码)
	
	@Column
	private String waitAudit;//是否需要审核(如需在自身系统进行审核处理，请记录下此信息)
	
	@Column
	private String params; //额外参数(比如虚拟商品的标示符)
	
	@Column
	private String type;//换类型：Alipay(支付宝),QB(Q币),Coupon(优惠券),Object(实物),Phonebill(话费),Virtual(虚拟商品) 所有类型不区分大小写
	
	@Column
	private String uid; //用户id
	
	@Column
	private String phone; //用户id
	
	@Column
	private String credits; //本次兑换用户所消耗的积分数
	
	@Column
	private String facePrice;//兑换商品的市场价值，单位是分，请自行转换单位
	
	@Column
	private String bizId; // 开发者的订单号
	
	@Column
	private Integer status;
	
	private User user; // 用户
	
	public String getQq() {
		return qq;
	}

	public void setQq(String qq) {
		this.qq = qq;
	}

	public String getAlipay() {
		return alipay;
	}

	public void setAlipay(String alipay) {
		this.alipay = alipay;
	}

	public String getActualPrice() {
		return actualPrice;
	}

	public void setActualPrice(String actualPrice) {
		this.actualPrice = actualPrice;
	}

	public String getIp() {
		return ip;
	}

	public void setIp(String ip) {
		this.ip = ip;
	}

	public String getOrderNum() {
		return orderNum;
	}

	public void setOrderNum(String orderNum) {
		this.orderNum = orderNum;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public String getWaitAudit() {
		return waitAudit;
	}

	public void setWaitAudit(String waitAudit) {
		this.waitAudit = waitAudit;
	}

	public String getParams() {
		return params;
	}

	public void setParams(String params) {
		this.params = params;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public String getUid() {
		return uid;
	}

	public void setUid(String uid) {
		this.uid = uid;
	}

	public String getPhone() {
		return phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	public String getCredits() {
		return credits;
	}

	public void setCredits(String credits) {
		this.credits = credits;
	}

	public String getFacePrice() {
		return facePrice;
	}

	public void setFacePrice(String facePrice) {
		this.facePrice = facePrice;
	}

	public String getBizId() {
		return bizId;
	}

	public void setBizId(String bizId) {
		this.bizId = bizId;
	}

	public Integer getStatus() {
		return status;
	}

	public void setStatus(Integer status) {
		this.status = status;
	}
	
	/**
	 * 获取状态名称
	 * @return
	 */
	public String getStatusName() {
		
		String name = "未知";
		if(this.getStatus() == null){
			return name;
		}
		
		switch(this.getStatus()) {
		case 0:
			name = "失败";
			break;
		case 1:
			name = "成功";
			break;
		case 2:
			name = "预扣";
			break;
		}
		
		return name;
	}

	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}
}
